#ifndef LINK_H
#define LINK_H

/**
 * \file	link.h
 * \brief	Declaration de la classe Link faisant le lien entre un segment de la source et un/plusieurs segment de la cible.
 */

#include "segmenttreelist.h"

class Link
{
	/*!
	 * \class Link
	 * \brief Classe faisant le lien entre un element caracteristique du cerveau source (ancetre de l'arbre cree) et un/plusieurs element du cerveau cible :
	 * 
	 * Chaque element de la source aura in fine un lien vers la cible par critere d'appariement (distance, aire, position, orientation, profondeur, ...).
	 * Ces multiples liens seront ensuite fusionnes pour donner le resultat de l'appariement qui sera finalement place dans l'arbre hierarchique des sillons.
	 *
	 */
	SegmentTree*			node;		/*! Node (ancester) we are searching for its matches in the target according to a criteria. Reference segment. */
	SegmentTreeList			match;		/*! List of all the elements in the target that are matched by the node according to a specific criteria. */
	
	public:
		/*!
		*  \brief Default constructor of the Link class.
		*
		*  Default constructor of the Link class : Every attributes are initialized to 0 (int,float,double,...) NULL (pointers) or are cleared (lists, stacks, ...).
		*/
		Link();
		
		/*!
		*  \brief Copy constructor of the Link class.
		*
		*  Copy constructor of the Link class : Every attributes are initialized to 0 (int,float,double,...) NULL (pointers) or are cleared (lists, stacks, ...).
		*/
		Link( const Link& _l );
		
		/*!
		*  \brief Destructor of the Link class.
		*
		*  Destructor of the Link class : Every attributes are initialized to 0 (int,float,double,...) NULL (pointers) or are cleared (lists, stacks, ...).
		*/
		~Link();
		
		/*!
		*  \brief Affectation operator of the Link class.
		*
		*  Affectation operator of the Link class : Every attributes are initialized to 0 (int,float,double,...) NULL (pointers) or are cleared (lists, stacks, ...).
		*/
		Link& operator= ( const Link& _l );
		
		/*!
		*  \brief Getter of the Link class.
		*
		*  Getter of the Link class.
		*
		*  \return (SegmentTree*) Returns the node in the source for which we are searching the matches.
		*/
		SegmentTree* getNode ();
		
		/*!
		*  \brief Getter of the Link class.
		*
		*  Getter of the Link class.
		*
		*  \return (SegmentTreeList) Returns a list componed by all the elements in the target that match the node according to the criteria.
		*/
		SegmentTreeList getMatch ();
		
		/*!
		*  \brief Setter of the Link class.
		*
		*  Setter of the Link class.
		*
		*  \param _s : Node to set as the matching reference of the link.
		*
		*  \return (void)
		*/
		void setNode ( SegmentTree* _s );
		
		/*!
		*  \brief Setter of the Link class.
		*
		*  Setter of the Link class.
		*
		*  \param _sl : Nodes list to set as the list containing all the matches in the target of the reference element.
		*
		*  \return (void)
		*/
		void setMatch ( SegmentTreeList _sl );
};

#endif // LINK_H
